package com.activenetwork.smlite.testcase.login;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;

import com.activenetwork.smlite.page.event.EventsHomeView;
import com.activenetwork.smlite.testcase.BaseCase;
import com.activenetwork.util.EnvContext;
import com.activenetwork.util.PageLoader;
import com.activenetwork.util.verification.gson.FailurePoint;

public class Login008 extends BaseCase {
	static final Logger logger = LoggerFactory.getLogger(Login008.class);
	
	
	@Test
	public void Check_user_can_click_Sign_In_to_login(){
		loginBusiness.login();
		EventsHomeView eventsHomeView = PageLoader.load(EventsHomeView.class);
		String loggedIn = eventsHomeView.getLoggeredInUser();
		
		if(!StringUtils.contains(loggedIn, "Logged in as:")){
			EnvContext.failurePointTL.get().add(new FailurePoint(
					Login008.class.getName(), 
					"Verify user can sign in", 
					"User can not sign in"));
		}
		loginBusiness.logout();
	}
}
